home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / PictUtils.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  8.8 KB  |  248 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT PictUtils;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PICTUTILS__}
  27. {$SETC __PICTUTILS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC PictUtilsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __PALETTES__}
  37. {$I Palettes.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45. { verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls }
  46.  
  47. CONST
  48.     returnColorTable            = $0001;
  49.     returnPalette                = $0002;
  50.     recordComments                = $0004;
  51.     recordFontInfo                = $0008;
  52.     suppressBlackAndWhite        = $0010;
  53.  
  54.                                                                 {  color pick methods  }
  55.     systemMethod                = 0;                            {  system color pick method  }
  56.     popularMethod                = 1;                            {  method that chooses the most popular set of colors  }
  57.     medianMethod                = 2;                            {  method that chooses a good average mix of colors  }
  58.                                                                 {  color bank types  }
  59.     ColorBankIsCustom            = -1;
  60.     ColorBankIsExactAnd555        = 0;
  61.     ColorBankIs555                = 1;
  62.  
  63.  
  64. TYPE
  65.     PictInfoID                            = LONGINT;
  66.     CommentSpecPtr = ^CommentSpec;
  67.     CommentSpec = RECORD
  68.         count:                    INTEGER;                                {  number of occurrances of this comment ID  }
  69.         ID:                        INTEGER;                                {  ID for the comment in the picture  }
  70.     END;
  71.  
  72.     CommentSpecHandle                    = ^CommentSpecPtr;
  73.     FontSpecPtr = ^FontSpec;
  74.     FontSpec = RECORD
  75.         pictFontID:                INTEGER;                                {  ID of the font in the picture  }
  76.         sysFontID:                INTEGER;                                {  ID of the same font in the current system file  }
  77.         size:                    ARRAY [0..3] OF LONGINT;                {  bit array of all the sizes found (1..127) (bit 0 means > 127)  }
  78.         style:                    INTEGER;                                {  combined style of all occurrances of the font  }
  79.         nameOffset:                LONGINT;                                {  offset into the fontNamesHdl handle for the font’s name  }
  80.     END;
  81.  
  82.     FontSpecHandle                        = ^FontSpecPtr;
  83.     PictInfoPtr = ^PictInfo;
  84.     PictInfo = RECORD
  85.         version:                INTEGER;                                {  this is always zero, for now  }
  86.         uniqueColors:            LONGINT;                                {  the number of actual colors in the picture(s)/pixmap(s)  }
  87.         thePalette:                PaletteHandle;                            {  handle to the palette information  }
  88.         theColorTable:            CTabHandle;                                {  handle to the color table  }
  89.         hRes:                    Fixed;                                    {  maximum horizontal resolution for all the pixmaps  }
  90.         vRes:                    Fixed;                                    {  maximum vertical resolution for all the pixmaps  }
  91.         depth:                    INTEGER;                                {  maximum depth for all the pixmaps (in the picture)  }
  92.         sourceRect:                Rect;                                    {  the picture frame rectangle (this contains the entire picture)  }
  93.         textCount:                LONGINT;                                {  total number of text strings in the picture  }
  94.         lineCount:                LONGINT;                                {  total number of lines in the picture  }
  95.         rectCount:                LONGINT;                                {  total number of rectangles in the picture  }
  96.         rRectCount:                LONGINT;                                {  total number of round rectangles in the picture  }
  97.         ovalCount:                LONGINT;                                {  total number of ovals in the picture  }
  98.         arcCount:                LONGINT;                                {  total number of arcs in the picture  }
  99.         polyCount:                LONGINT;                                {  total number of polygons in the picture  }
  100.         regionCount:            LONGINT;                                {  total number of regions in the picture  }
  101.         bitMapCount:            LONGINT;                                {  total number of bitmaps in the picture  }
  102.         pixMapCount:            LONGINT;                                {  total number of pixmaps in the picture  }
  103.         commentCount:            LONGINT;                                {  total number of comments in the picture  }
  104.         uniqueComments:            LONGINT;                                {  the number of unique comments in the picture  }
  105.         commentHandle:            CommentSpecHandle;                        {  handle to all the comment information  }
  106.         uniqueFonts:            LONGINT;                                {  the number of unique fonts in the picture  }
  107.         fontHandle:                FontSpecHandle;                            {  handle to the FontSpec information  }
  108.         fontNamesHandle:        Handle;                                    {  handle to the font names  }
  109.         reserved1:                LONGINT;
  110.         reserved2:                LONGINT;
  111.     END;
  112.  
  113.     PictInfoHandle                        = ^PictInfoPtr;
  114. {$IFC TYPED_FUNCTION_POINTERS}
  115.     InitPickMethodProcPtr = FUNCTION(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16): OSErr;
  116. {$ELSEC}
  117.     InitPickMethodProcPtr = ProcPtr;
  118. {$ENDC}
  119.  
  120.     InitPickMethodUPP = UniversalProcPtr;
  121.  
  122. CONST
  123.     uppInitPickMethodProcInfo = $00000FA0;
  124.  
  125. FUNCTION NewInitPickMethodProc(userRoutine: InitPickMethodProcPtr): InitPickMethodUPP;
  126.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  127.     INLINE $2E9F;
  128.     {$ENDC}
  129.  
  130. FUNCTION CallInitPickMethodProc(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16; userRoutine: InitPickMethodUPP): OSErr;
  131.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  132.     INLINE $205F, $4E90;
  133.     {$ENDC}
  134.  
  135. TYPE
  136. {$IFC TYPED_FUNCTION_POINTERS}
  137.     RecordColorsProcPtr = FUNCTION(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32): OSErr;
  138. {$ELSEC}
  139.     RecordColorsProcPtr = ProcPtr;
  140. {$ENDC}
  141.  
  142.     RecordColorsUPP = UniversalProcPtr;
  143.  
  144. CONST
  145.     uppRecordColorsProcInfo = $00003FE0;
  146.  
  147. FUNCTION NewRecordColorsProc(userRoutine: RecordColorsProcPtr): RecordColorsUPP;
  148.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  149.     INLINE $2E9F;
  150.     {$ENDC}
  151.  
  152. FUNCTION CallRecordColorsProc(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32; userRoutine: RecordColorsUPP): OSErr;
  153.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  154.     INLINE $205F, $4E90;
  155.     {$ENDC}
  156.  
  157. TYPE
  158. {$IFC TYPED_FUNCTION_POINTERS}
  159.     CalcColorTableProcPtr = FUNCTION(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray): OSErr;
  160. {$ELSEC}
  161.     CalcColorTableProcPtr = ProcPtr;
  162. {$ENDC}
  163.  
  164.     CalcColorTableUPP = UniversalProcPtr;
  165.  
  166. CONST
  167.     uppCalcColorTableProcInfo = $00003EE0;
  168.  
  169. FUNCTION NewCalcColorTableProc(userRoutine: CalcColorTableProcPtr): CalcColorTableUPP;
  170.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  171.     INLINE $2E9F;
  172.     {$ENDC}
  173.  
  174. FUNCTION CallCalcColorTableProc(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray; userRoutine: CalcColorTableUPP): OSErr;
  175.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  176.     INLINE $205F, $4E90;
  177.     {$ENDC}
  178.  
  179. TYPE
  180. {$IFC TYPED_FUNCTION_POINTERS}
  181.     DisposeColorPickMethodProcPtr = FUNCTION(dataRef: UInt32): OSErr;
  182. {$ELSEC}
  183.     DisposeColorPickMethodProcPtr = ProcPtr;
  184. {$ENDC}
  185.  
  186.     DisposeColorPickMethodUPP = UniversalProcPtr;
  187.  
  188. CONST
  189.     uppDisposeColorPickMethodProcInfo = $000000E0;
  190.  
  191. FUNCTION NewDisposeColorPickMethodProc(userRoutine: DisposeColorPickMethodProcPtr): DisposeColorPickMethodUPP;
  192.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  193.     INLINE $2E9F;
  194.     {$ENDC}
  195.  
  196. FUNCTION CallDisposeColorPickMethodProc(dataRef: UInt32; userRoutine: DisposeColorPickMethodUPP): OSErr;
  197.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  198.     INLINE $205F, $4E90;
  199.     {$ENDC}
  200. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  201.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  202.     INLINE $303C, $0800, $A831;
  203.     {$ENDC}
  204. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  205.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  206.     INLINE $303C, $0801, $A831;
  207.     {$ENDC}
  208. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  209.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  210.     INLINE $303C, $0602, $A831;
  211.     {$ENDC}
  212. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  213.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  214.     INLINE $303C, $0403, $A831;
  215.     {$ENDC}
  216. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  217.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  218.     INLINE $303C, $0404, $A831;
  219.     {$ENDC}
  220. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  221.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  222.     INLINE $303C, $0505, $A831;
  223.     {$ENDC}
  224. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  225.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  226.     INLINE $303C, $0206, $A831;
  227.     {$ENDC}
  228. {$IFC OLDROUTINENAMES }
  229. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  230.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  231.     INLINE $303C, $0206, $A831;
  232.     {$ENDC}
  233. {$ENDC}  {OLDROUTINENAMES}
  234.  
  235.  
  236.  
  237.  
  238. {$ALIGN RESET}
  239. {$POP}
  240.  
  241. {$SETC UsingIncludes := PictUtilsIncludes}
  242.  
  243. {$ENDC} {__PICTUTILS__}
  244.  
  245. {$IFC NOT UsingIncludes}
  246.  END.
  247. {$ENDC}
  248.